Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue-423 - Propagate errors in SitemapAndIndexStream #424

Merged
merged 7 commits into from
May 22, 2024

Conversation

huntharo
Copy link
Contributor

@huntharo huntharo commented May 21, 2024

Fixes #423

@huntharo
Copy link
Contributor Author

@derduher - We have a choice here. We can merge this to show the isolated test / fix OR we can merge a larger fix that addresses other issues with SitemapAndIndexStream and is easier to understand / maintain.

@derduher
Copy link
Collaborator

@huntharo I'm about to release a version that will be the last before a breaking change that drops support for node < 18. So if you have a preference now is the time to voice it :)

@huntharo huntharo changed the title Issue-423 - Failing test when SitemapStream error Issue-423 - Propagate errors in SitemapAndIndexStream May 22, 2024
@huntharo huntharo force-pushed the issue-423/failing-test branch from 8bf5a4f to 6deb614 Compare May 22, 2024 00:15
@huntharo
Copy link
Contributor Author

@huntharo I'm about to release a version that will be the last before a breaking change that drops support for node < 18. So if you have a preference now is the time to voice it :)

We should probably get these changes out before the node 12, 14, 16 drop.

@huntharo huntharo force-pushed the issue-423/failing-test branch from 7d3815c to 510925c Compare May 22, 2024 00:23
@huntharo huntharo force-pushed the issue-423/failing-test branch from cbaa441 to 655b30b Compare May 22, 2024 02:17
@huntharo
Copy link
Contributor Author

@derduher You can proceed with dropping Node 12 support. The stream handling in Node 12 is pretty bad so one of the tests fails with Node 12 and can't be made to work.

@derduher
Copy link
Collaborator

derduher commented May 22, 2024 via email

@derduher
Copy link
Collaborator

I'm still reviewing this but in running npm run test:perf -- 3 3 stream true This MR has dropped peak memory usage by 1000x. from 78mb to 78kb. I had to modify the script to drop down a unit.

@derduher derduher merged commit aa142fe into ekalinin:master May 22, 2024
2 of 3 checks passed
@derduher
Copy link
Collaborator

@huntharo thank you! Also be sure to see my comment above about the improved memory performance.

@huntharo huntharo deleted the issue-423/failing-test branch May 22, 2024 04:45
@huntharo
Copy link
Contributor Author

huntharo commented May 22, 2024

npm run test:perf -- 3 3 stream true

Hmm... I'm running that test but I'm not seeing a change in memory usage?

Yeah I don't think this PR changes anything that could impact that test?

@derduher
Copy link
Collaborator

yeah I think you are right. After merging the improvement in memory is gone. 🤷

@huntharo
Copy link
Contributor Author

huntharo commented May 22, 2024

 npm run test:perf -- 3 3 stream true     

> [email protected] test:perf
> node ./tests/perf.js 3 3 stream true

npm run test:perf -- [number of runs = 10] [batch size = 10] [stream(default)|combined] [measure peak memory = false]
runs: 3 batches: 3 total: 9
testing stream
========= stream =============
median: 0.0±0.0mb
99th percentile: 0.0mb

Now I'm getting the improvement, for the first time that I have observed. We should try to figure out what is going on here.

Key point: the imports in perf.js are from ../dist/ so they will be the last npm run build version of the code, not the latest .ts version of the code. This makes it possible to misattribute the fix to the wrong code. It's possible some other recent PR fixed this. We should be able to do a git bisect to find it.

@huntharo
Copy link
Contributor Author

Added #436 - The change is due to Node v18 -> v20... not due to any code change. Not sure yet if it is a change in memory reporting or a change in memory use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ BUG ] SitemapAndIndexStream hangs on end if SitemapStream encountered error writing to its destination
2 participants